package com.exam.api.modules.exampaper.controller.manager;

import com.exam.api.common.web.TinyResponse;
import com.exam.api.modules.exampaper.domain.TblExamPaperQuestion;
import com.exam.api.modules.exampaper.service.TblExamPaperQuestionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * (管理端) 试卷题目明细相关接口
 */
@Tag(name = "(管理端) 试卷题目明细相关接口", description = "(管理端) 试卷题目明细相关接口")
@RestController
@RequestMapping("/manager/examPaperQuestion")
@TinyResponse
public class TblExamPaperQuestionManagerController {

    @Resource
    private TblExamPaperQuestionService tblExamPaperQuestionService;

//    @Operation(summary = "创建试卷题目", description = "创建试卷题目")
//    @PostMapping("/create")
//    public void createTblExamPaperQuestion(@RequestBody TblExamPaperQuestion tblExamPaperQuestion) {
//        tblExamPaperQuestionService.save(tblExamPaperQuestion);
//    }
//
    @Operation(summary = "修改试卷题目", description = "修改试卷题目")
    @PostMapping("/update")
    public void updateTblExamPaperQuestion(@RequestBody TblExamPaperQuestion tblExamPaperQuestion) {
        tblExamPaperQuestionService.updateById(tblExamPaperQuestion);
    }
//
//    @Operation(summary = "删除试卷题目", description = "删除试卷题目")
//    @PostMapping("/delete/{id}")
//    public void deleteTblExamPaperQuestion(@PathVariable Long id) {
//        tblExamPaperQuestionService.removeById(id);
//    }

    @Operation(summary = "根据ID获取试卷题目", description = "根据ID获取试卷题目")
    @PostMapping("/{id}")
    public TblExamPaperQuestion getTblExamPaperQuestion(@PathVariable("id") Long id) {
        return tblExamPaperQuestionService.getById(id);
    }
}